package com.zq.spring.springexpand;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

/**
 * @Author: zhaoqi
 * @Date: 2020/4/30 16:18
 * @Version 1.0
 */

public class LifecycleBean implements InitializingBean, DisposableBean {
    @SuppressWarnings("unused")
    private String lifeCycleBeanName;

    public void setLifeCycleBeanName(String lifeCycleBeanName)
    {
        System.out.println("Enter LifecycleBean.setLifeCycleBeanName(), lifeCycleBeanName = " + lifeCycleBeanName);
        this.lifeCycleBeanName = lifeCycleBeanName;
    }


    public void destroy() throws Exception
    {
        System.out.println("Enter LifecycleBean.destroy()");
    }

    public void afterPropertiesSet() throws Exception
    {
        System.out.println("Enter LifecycleBean.afterPropertiesSet()");
    }

    public void beanStart()
    {
        System.out.println("Enter LifecycleBean.beanStart()");
    }

    public void beanEnd()
    {
        System.out.println("Enter LifecycleBean.beanEnd()");
    }
}
